const router = require('koa-router')();
const blogModel = require('../model/blog');
router.post('/doAdd', async ctx=>{
    var {title,content} = ctx.request.body
    var data = new blogModel({
        title,
        content
    })
    data.save( err=>{
        if(err) throw err;
    })
    await ctx.redirect('/')
})
module.exports = router;